export default function statistics(arr) {
  const data = []
  const eventchart = true

  function arrGroup(array, fn) {
    const obj = {}
    array.forEach((item) => {
      const key = JSON.stringify(fn(item))
      obj[key] = obj[key] || []
      obj[key].push(item)
    })
    return Object.keys(obj).map((k) => {
      return obj[k]
    })
  }

  const newArr = arrGroup(arr.value, (item) => item.事件类型)

  newArr.map((item) => {
    data.push({ type: item[0].事件类型, value: item.length })
  })

  return { data }
}
